package conexion;

import com.mysql.jdbc.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
 *
 * @author El APRENDIZ www.elaprendiz.net63.net
 */
public class AdminConexion {
    private static Connection cn = null;
    private static String dbUrl = "jdbc:mysql://localhost/bdbomberos";
    
    public static Connection init_conexion()
    {
        try {
              Class.forName("com.mysql.jdbc.Driver");            
              cn = (Connection)DriverManager.getConnection(dbUrl, "SAVE", "witsoft");
            if(cn != null)
                return cn;
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(AdminConexion.class.getName()).log(Level.SEVERE, null, ex);
        }catch (SQLException ex) {
                Logger.getLogger(AdminConexion.class.getName()).log(Level.SEVERE, null, ex);
            }
        return cn;
    }  
}
